<?php
session_start();
if(!@$_SESSION['username']) {
  echo "<script>window.location.href='login.php';</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>exit</title>
</head>
<body>
	<?php
		if(session_destroy()) {
			echo "<script>alert('退出成功');window.location.href='../../index.php';</script>";
		}else{
			echo "<script>alert('退出失败');history.go(-1);';</script>";
		}
	?>
</body>
</html>